package Sort;

public class BubbleSort {
    public static void main(String[] args) {
        int[] nums = {3, 2, 1, 7};

    }

    public void bubbleSort(int[] nums){
        int n = nums.length;
        for(int i = 0; i < n - 1; i++){
            for(int j = 0; j < n - 1 - i; j++){
                if(nums[j] > nums[j + 1]){
                    swap(nums, j, j + 1);
                }
            }
        }
    }

    private void swap(int[] nums, int i, int j){
        int temp;
        temp = nums[i];
        nums[i] = nums[j];
        nums[j] = temp;
    }
}
